package com.dt76.smallloanbackendservice.service.hzp.Impl;

import com.dt76.smallloanbackendservice.mapper.hzp.HContractTemplateMapper;
import com.dt76.smallloanbackendservice.pojo.hzp.HContractTemplate;
import com.dt76.smallloanbackendservice.service.hzp.HContractTemplateService;
import com.dt76.smallloanbackendservice.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HContractTemplateServiceImpl implements HContractTemplateService {
    @Autowired
    private HContractTemplateMapper contractTemplateMapper;
    @Override
    public List<HContractTemplate> qryAllHCT() {
        return contractTemplateMapper.qryAllHCT();
    }

    @Override
    public Page getPageHCT(Page page) {
        page.setTotalCount(contractTemplateMapper.count());
        page.setRows(contractTemplateMapper.pageHCT((page.getPageIndex()-1)*page.getPageSize(),page.getPageSize()));
        return page;
    }


}
